Component({
    data: {
        left: '',
        valve: false,
        marRight: '',
        top: ''
    },

    ready() {
        const menuButtonInfo = wx.getMenuButtonBoundingClientRect()
        const {
            screenWidth
        } = wx.getSystemInfoSync()
        console.log('menuButtonInfo', menuButtonInfo, screenWidth)
        this.setData({
            marRight: screenWidth - menuButtonInfo.right + menuButtonInfo.width * 3 / 4 - 6 + 'px',
            left: screenWidth - menuButtonInfo.right + menuButtonInfo.width - 50 + 'px',
            top: menuButtonInfo.bottom + 3 + 'px'
        })
        wx.getStorage({
            key: 'valve',
            fail: (err) => {
                this.setData({
                    valve: true
                })
                wx.setStorage({
                    key: 'valve',
                    data: '1',
                })
            }
        })
    },
    methods: {
        onClose() {
            wx.setStorage({
                key: 'valve',
                data: '1',
                success:()=>{
                    this.setData({
                        valve: false
                    })
                }
            })
        }
    }

})